{% assign revision=include.revision %}

{% if revision != "ce" %}
{% if page.ee_only == true and revision == 'ee' and page.se_support == nil %}
{% alert level="warning" %}
Installation of {{ page.title_main }} is only possible in the Enterprise Edition. [See information about commercial editions](/products/kubernetes-platform/).
{% endalert %}
{% endif %}
{% include getting_started/global/EE_ACCESS.md revision=revision %}
<div class="dimmer-block-content{% if page.ee_only %} disabled{% endif %}">
{% endif %}

<div markdown="1">
  The recommended settings for a Deckhouse Kubernetes Platform {{ site.data.i18n[revision] }} installation are generated below:
- `config.yml` — a file with the configuration needed to bootstrap the cluster. Contains the installer parameters, {% if page. platform_type== 'cloud' %}cloud provider related parameters (such as credentials, instance type, etc), description of the resources that must be installed after the installation (nodes description, Ingress controller description, etc), access parameters{% endif %} and the initial cluster parameters.

**Please pay attention to**:
- <span class="mustChange">highlighted</span> parameters you *must* define.
- <span class="mightChange">parameters</span> you might want to change.
{%- if page.platform_type == 'baremetal' %}
- The installation must be performed from a **personal computer** with SSH access to the node, the **master node** of the future cluster.
{%- endif %}
{%- if page.platform_type == 'existing' %}
- We recommend that you read the section *[If something went wrong](#if-something-went-wrong)* first; perhaps, your ISP case is already addressed there. Refer to it if you have any problems during the installation process.
{%- endif %}

Create the `config.yml` file.

{% if page.platform_code == 'bm-private' or page.platform_code == 'bm' or page.platform_code == 'red' or page.platform_code == 'spacevm' %}

<div class="tabs">
  <a id='tab_variant_worker_{{ revision }}'
     href="javascript:void(0)"
     class="tabs__btn tabs__btn_variant_{{ revision }} active"
     onclick="openTabAndSaveStatus(event,'tabs__btn_variant_{{ revision }}','tabs__content_variant_{{ revision }}','block_variant_worker_{{ revision }}','dhctl-variant','worker');">
     A cluster of several nodes 
  </a>
  <a id='tab_variant_single_{{ revision }}'
     href="javascript:void(0)"
     class="tabs__btn tabs__btn_variant_{{ revision }}"
     onclick="openTabAndSaveStatus(event,'tabs__btn_variant_{{ revision }}','tabs__content_variant_{{ revision }}','block_variant_single_{{ revision }}','dhctl-variant','single');">
     A cluster of a single node
  </a>
</div>

<div id='block_variant_worker_{{ revision }}' class="tabs__content tabs__content_variant_{{ revision }} active" markdown="1">
  {% capture includePath %}_includes/getting_started/{{ page.platform_code }}/partials/config.yml{% if include.layout.size > 0 %}.{{ include.layout }}{% endif %}.{% if revision != "ce" %}other{% else %}{{ revision }}{% endif %}.inc{% endcapture %}
  {% include_file "{{ includePath }}" syntax="yaml" %}
</div>

<div id='block_variant_single_{{ revision }}' class="tabs__content tabs__content_variant_{{ revision }}" markdown="1">
  {% capture includePathSingle %}_includes/getting_started/{{ page.platform_code }}/partials/config.yml{% if include.layout.size > 0 %}.{{ include.layout }}{% endif %}.{% if revision != "ce" %}other{% else %}{{ revision }}{% endif %}.single.inc{% endcapture %}
  {% include_file "{{ includePathSingle }}" syntax="yaml" %}
</div>

{% else %}

{% capture includePath %}_includes/getting_started/{{ page.platform_code }}/partials/config.yml{% if include.layout.size > 0 %}.{{ include.layout }}{% endif %}.{% if revision != "ce" %}other{% else %}{{ revision }}{% endif %}.inc{% endcapture %}
{% include_file "{{ includePath }}" syntax="yaml" %}

{% endif %}

{%- if page.platform_type == 'existing' %}
{% offtopic title="About nodeSelector, taints and tolerations..." %}
You can control which nodes the Deckhouse kernel will run on by using the `spec.setting.nodeSelector` parameter in the ModuleConfig `deckhouse` of the installation configuration.

> Example of specifying a `nodeSelector` for the 'deckhouse` module for the rest of the Deckhouse components to work (do not copy this example without changing your configuration, because you will have other values):
> ```yaml
> apiVersion: deckhouse.io/v1alpha1
> kind: ModuleConfig
> metadata:
>   name: deckhouse
>   spec:
>     version: 1
>     enabled: true
>   settings:
>     nodeSelector:
>       node-role.kubernetes.io/master: master
> ```

Also, you can list the necessary cluster node taints in ModuleConfig `global` in the array `.spec.settings.modules.placement.customTolerationKeys` so that Deckhouse automatically specifies the appropriate tolerance for its components.

> Example of specifying `customTolerationKeys` for the 'deckhouse` module and the list of tolerations in the `customTolerationKeys` array for the rest of the Deckhouse components to work (do not copy this example without changing your configuration, because you will have other values):
> ```yaml
> apiVersion: deckhouse.io/v1alpha1
> kind: ModuleConfig
> metadata:
>   name: global
> spec:
>   settings:
>     modules:
>       placement:
>         customTolerationKeys:
>         - Systemload
>         - kubernetes.io/instance
> ```
{% endofftopic %}
{% endif %}
</div>

<script>
  $(document).ready(function() {
    var root = document.getElementById('block_layout_{{ revision }}');
    if (!root) return; // на шаге 2 этого блока нет — выходим тихо

    root.querySelectorAll('span').forEach(function (el) {
      el.textContent = el.textContent.replace('<REVISION>', '{{ revision }}');
    });
    root.querySelectorAll('.dimmer-block-content div .snippetcut .snippetcut__raw').forEach(function (el) {
      el.textContent = el.textContent.replace('<REVISION>', '{{ revision }}');
    });
  });
</script>

{% if revision != "ce" %}
</div>
{% endif %}
